<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" data-th-replace="~{public::layui}">
    <style>
        .layui-form .btns {
            text-align: center;
        }
        body {
            padding-top: 20px;
            padding-right: 10px;
        }
    </style>
</head>
<body>
    <form class="layui-form" >
<!--        <input type="hidden" name="pid">-->
        <div class="layui-form-item">
            <div class="layui-form-label">父资源:</div>
            <div class="layui-input-inline">
                <select name="pid">
                    <option value="-1">请选择父资源</option>
                    <option data-th-each="res : ${resourceList}"
                            data-th-value="${res.id}" data-th-text="${res.name}"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-form-label">资源名称:</div>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="name" lay-verify="required" lay-reqText="资源名称不能为空" >
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-form-label">资源代码:</div>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="code" lay-verify="required" lay-reqText="资源代码不能为空" >
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-form-label">资源路径:</div>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" name="url" >
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-form-label">资源类型:</div>
            <div class="layui-input-inline">
                <select class="layui-input" name="type" lay-verify="required" lay-reqText="资源类型不能为空" >
                    <option value="" >请选择资源类型</option>
                    <option data-th-each="resourceType : ${resourceTypes}"
                            data-th-value="${resourceType.id}"
                            data-th-text="${resourceType.name}"
                    ></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item btns">
            <button class="layui-btn-normal layui-btn "  lay-submit lay-filter="add-form"><i class="layui-icon layui-icon-addition"></i>新增资源</button>
        </div>
    </form>
    <script data-th-replace="~{public::js('resources','资源','add')}"></script>
</body>
</html>